﻿@using MealBooking.Core.Models.Meals;
@model List<MealCategory>
@{
    ViewBag.HeaderTitle = "All Meal Categories";
    Layout = "../Shared/_Layout.cshtml";
}
<!--Navbar-->
<div data-role="navbar" data-iconpos="left">
    @Html.Partial("_FloatRightPartial")
</div>
<!--Navbar End-->
<ul data-role="listview" data-inset="true" data-mini="true">
    @{
        var mealCategories = Model;
        if (mealCategories == null || mealCategories.Count == 0)
        {
        <li data-role="list-divider"></li>
        <li><a href="@Url.Action("AddNewMealCategory")">No Meal Categories Yet. Click to Add
            New Meal Category</a></li>
        }
        else
        {
        <li data-role="list-divider"><span class="ui-li-count">@mealCategories.Count</span>
        </li>
            foreach (var mealCategory in mealCategories)
            {
        <li><a href="@Url.Action("MealCategoryDetail", new { id = mealCategory.Id })">
            <h4>@mealCategory.Name</h4>
            <p>@mealCategory.Description</p>
        </a></li>
            }
        }
    }
</ul>
